﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Printing;


namespace YTSK.Common
{
    class handlePrinter
    {
        public static void getAllPrinter(ComboBox cb)
        {
            PrintDocument print = new PrintDocument();
            string sDefault = print.PrinterSettings.PrinterName;//默认打印机名
            cb.Items.Clear();
            foreach (string sPrint in PrinterSettings.InstalledPrinters)//获取所有打印机名称
            {
                cb.Items.Add(sPrint);
            }
            cb.SelectedItem = sDefault;
        }
    }
}
